package com.hrg.rds.infra.connect.protocol.modbus;


import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
@EnableConfigurationProperties(ModbusProperties.class)
@ConditionalOnProperty(prefix = "modbus", name = "enabled", havingValue = "true")
public class ModbusConfiguration {

	@Bean
	public ModbusConnectionHolder modbusConnectionHolder(ModbusProperties modbusProperties) {
		return new ModbusConnectionHolder(modbusProperties);
	}
}
